package com.heima.admin;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@SpringBootApplication
@MapperScan("com.heima.admin.mapper")//此处打上这个注解之后mapper层中就不用打上@mapper注解
@EnableDiscoveryClient //将admin服务加入到nacos注册中心中
public class AdminApplication {
    public static void main(String[] args) {
        SpringApplication.run(AdminApplication.class, args);
    }
    @Bean //设置分页插件

    public PaginationInterceptor paginationInterceptor(){
        return new PaginationInterceptor();
    }
}
